import { createMemoryHistory, createRouter } from 'vue-router'

import Welcome from '../components/Welcome.vue'
import Login from '../components/login.vue'
import StudentManager from '../components/view/student/studentManager.vue'
import CourseManager from '../components/view/course/courseManager.vue'
import AdminManager from '../components/AdminManager.vue'
const routes = [
  { path: '/', component: Login },
  { path: '/admin', component: AdminManager ,
    redirect: 'admin/welcome',
    children: [
      { path: 'welcome', component: Welcome },
      { path:'studentManager', component: StudentManager },
      { path: 'courseManager', component: CourseManager },
    ]

  },
  { path: '/login', component: Login }
]

const router = createRouter({
  history: createMemoryHistory(),
  routes,
})

export default router